variable = expression
The = operator assign the expression on the right side to the variable in left side.
print(expression[,expression2, expression3,…])
The print() function prints the given expression on the console screen
variable = input(string)
name = input("Enter your name:") age = input("Enter your age:") age = int(age)
x = input("Enter anything:")
name = input("Enter a name") age = input("Enter an age ")Output
print("Hello ",name," my age is also ",age)
Here is the output:
name = input("Enter a name”) age = input("Enter an age ”) age = int(age) ageNextYear = age + 1 print("Hello ",name," you will be ", ageNextYear, "next year" )
price = input("Enter the price of item ") price = float(price) qty = input("Enter the quantity ") qty = int(qty total = price * qty print("Total price ",total," dhs")Here is the output: